/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --dark: #1d3557;
    --darker: #0d1b2a;
    --light: #f8f9fa;
    --gray: #8d99ae;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --card-bg: rgba(29, 53, 87, 0.8);
    --transition: all 0.3s ease;
}

body {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    color: var(--light);
    min-height: 100vh;
    background-attachment: fixed;
    line-height: 1.6;
}

/* 页头样式 */
header {
    background-color: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light);
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(67, 97, 238, 0.2);
    color: var(--accent);
}

.nav-links a i {
    font-size: 1.2rem;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
}

/* 返回按钮 */
.back-button {
    margin: 1rem 0;
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.back-button:hover {
    transform: translateX(-5px);
}

.back-button i {
    margin-right: 0.5rem;
}

/* 主内容区样式 */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* 内容详情卡片 */
.content-detail-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.content-detail-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.detail-header {
    display: flex;
    flex-wrap: wrap;
}

.detail-image {
    width: 300px;
    height: 450px;
    object-fit: cover;
}

.detail-info {
    flex: 1;
    padding: 2rem;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.detail-meta {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.detail-meta span {
    margin-right: 1rem;
}

.detail-rating {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.detail-rating .stars {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.detail-rating .rating-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.detail-description {
    color: var(--light);
    margin-bottom: 1.5rem;
}

.detail-creators {
    color: var(--gray);
}

.detail-creators p {
    margin-bottom: 0.5rem;
}

/* 评论区样式 */
.reviews-section {
    margin-bottom: 3rem;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.reviews-title {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    padding-left: 1rem;
}

.reviews-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.write-review-btn {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.write-review-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* 评论表单 */
.review-form-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.review-form-container:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.review-form-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.rating-stars {
    display: flex;
    margin-bottom: 1.5rem;
}

.rating-star {
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    margin-right: 0.5rem;
}

.rating-star:hover, .rating-star.active {
    color: var(--warning);
}

.review-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    color: var(--light);
    resize: none;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.review-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.review-form-actions {
    display: flex;
    justify-content: flex-end;
}

.submit-review-btn {
    background: var(--primary);
    color: white;
    padding: 0.7rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-review-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* 已有评论样式 */
.existing-review {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.existing-review:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.review-user {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.user-info .username {
    font-weight: 600;
}

.user-info .review-date {
    color: var(--gray);
    font-size: 0.9rem;
}

.review-rating {
    color: var(--warning);
}

.review-content {
    color: var(--light);
    margin-bottom: 1rem;
}

.review-actions {
    display: flex;
    gap: 1rem;
}

.review-action {
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.review-action:hover {
    color: var(--accent);
}

/* 成功消息样式 */
.success-message {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4caf50;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 5px 5px 0;
    display: flex;
    align-items: center;
    animation: fadeIn 0.5s ease-in-out;
}

.success-message i {
    margin-right: 10px;
    color: #4caf50;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 0.3rem;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-item:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
}

.pagination-item.active {
    background: var(--primary);
    color: white;
}

/* 页脚样式 */
footer {
    background: rgba(13, 27, 42, 0.95);
    padding: 3rem 2rem 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-col h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-links a i {
    width: 20px;
    text-align: center;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-size: 0.9rem;
}

/* 搜索区域 */
.search-section {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 3rem;
}

.search-section h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.search-section p {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    background: var(--card-bg);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--light);
    font-size: 1.1rem;
}

.search-input:focus {
    outline: none;
}

.search-select {
    padding: 0 1.5rem;
    background: rgba(67, 97, 238, 0.3);
    border: none;
    color: var(--light);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.search-button {
    padding: 0 2rem;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-button:hover {
    background: var(--secondary);
}

/* 分类导航 */
.category-section {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    padding-left: 1rem;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.view-all {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.category-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.8) 90%);
    z-index: 1;
}

.category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-content {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
}

.category-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-count {
    color: var(--gray);
    font-size: 0.9rem;
}

/* 热门内容 */
.top-content-section {
    margin-bottom: 3rem;
}

.top-content-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.top-content-section .section-title {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    padding-left: 1rem;
}

.top-content-section .section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.top-content-section .view-all {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.content-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.tab.active {
    background: rgba(67, 97, 238, 0.2);
    color: var(--accent);
}

.tab:hover {
    background: rgba(67, 97, 238, 0.2);
    color: var(--accent);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.content-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.content-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

.content-info {
    padding: 1.5rem;
}

.content-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.content-meta {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 0.2rem;
}

.stars i {
    color: var(--warning);
}

.rating-value {
    font-size: 0.9rem;
}

.content-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.content-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 10px;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--light);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background-color: rgba(67, 97, 238, 0.3);
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .auth-buttons {
        margin-top: 1rem;
    }

    .search-section h1 {
        font-size: 2.2rem;
    }

    .detail-image {
        width: 100%;
        height: 300px;
    }

    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        border-radius: 15px;
    }

    .search-select {
        padding: 1rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .search-button {
        padding: 1rem;
    }

    .categories {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .content-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .view-all {
        align-self: flex-end;
    }

    .categories {
        grid-template-columns: 1fr 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}